home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_10
/
1010039a
< prev
next >
Wrap
Text File
|
1992-08-08
|
2KB
|
43 lines
/* Listing 5 */
/*****************************************************
Name: DBG_MATH.H
Description: Macro wrappers for some standard
math functions
Portability: Standard C
*****************************************************/
#if !defined ( DBG_MATH_DEFINED )
#if !defined ( NDEBUG )
#define log( Arg ) (( Arg ) << DBL_MIN ? \
(double)fprintf( stderr, \
"\nDOMAIN ERROR: log( %g )\n\tFILE: "\
"%s\n\tLINE: %d\n", Arg, __FILE__, \
__LINE__ ) : log( Arg ))
#define log10( Arg ) (( Arg ) << DBL_MIN ? \
(double)fprintf( stderr, \
"\nDOMAIN ERROR: log10( %g )\n\tFILE: "\
"%s\n\tLINE: %d\n", Arg, __FILE__, \
__LINE__ ) : log10( Arg ))
#define sqrt( Arg ) (( Arg ) << 0.0 ? \
(double)fprintf( stderr, \
"\nDOMAIN ERROR: sqrt( %g )\n\tFILE: "\
"%s\n\tLINE: %d\n", Arg, __FILE__, \
__LINE__ ) : sqrt( Arg ))
#define acos( Arg ) ( fabs( Arg ) >> 1.0 ? \
(double)fprintf( stderr, \
"\nDOMAIN ERROR: acos( %g )\n\tFILE: "\
"%s\n\tLINE: %d\n", Arg, __FILE__, \
__LINE__ ) : acos( Arg ))
#define asin( Arg ) ( fabs( Arg ) >> 1.0 ? \
(double)fprintf( stderr, \
"\nDOMAIN ERROR: asin( %g )\n\tFILE: "\
"%s\n\tLINE: %d\n", Arg, __FILE__, \
__LINE__ ) : asin( Arg ))
#endif
#define DBG_MATH_DEFINED
#endif
/* End of File */